package com.example.qxglxt.model;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

//import org.hibernate.annotations.GenericGenerator;

import lombok.Data;

@Data
@Entity
@Table
//@GenericGenerator(name = "jpa-uuid",strategy = "uuid")
public class Roles {

    @Id//主键
    @GeneratedValue //(generator = "jpa-uuid")//自动生成ID
    private Integer Id;//用户组编号
    private String Name;//角色名称
    private Integer status;//预留int
    private String remark;//预留字符串
    @ManyToOne(targetEntity = UserRoles.class)
    @NotFound(action = NotFoundAction.IGNORE)//找不到外键引用时忽略
    private UserRoles role;
    @ManyToOne(targetEntity = RoleModules.class)
    @NotFound(action = NotFoundAction.IGNORE)//找不到外键引用时忽略
    private RoleModules ModulesId;  
}